package cn;

import java.sql.Date;

import javax.print.attribute.standard.RequestingUserName;

public class Equation {
	private static int x;

	double[] rection(double a, double b, double c) {
		double date = b * b - 4 * a * c;
		if (date < 0)
			return null;
		else if (date == 0) {
			double x = (-b + Math.sqrt(date)) / (2 * a);
			return new double[] { 1 };
		} else {
			double x1 = (-b + Math.sqrt(date)) / (2 * a);
			double x2 = (-b + Math.sqrt(date)) / (2 * a);
			return new double[] { 2 };
		}
	}

	public static void main(String[] args) {
		Equation e = new Equation();
		double[] arr = e.rection(1, 9, 2);
		if (arr == null)
			System.out.println("无解");
		else if (arr.length == 1)
			System.out.println("有一个解:" + arr[x]);
		else if (arr.length == 2) {
			System.out.println("有两个解：" + arr[x]);
		}

	}

}
